/**
 * 
 */
package org.startup.healthchecks;

import com.codahale.metrics.health.HealthCheck;

/**
 * @author asudar
 * 
 */
public class StartupHealthCheck extends HealthCheck {

	private final String template;

	/**
	 * @param template
	 */
	public StartupHealthCheck(String template) {
		super();
		this.template = template;
	}

	@Override
	protected Result check() throws Exception {
		final String saying = String.format(template, "TEST");
		if (!saying.contains("TEST")) {
			return Result.unhealthy("template doesn't include a name");
		}
		return Result.healthy();
	}

}
